package cn.com.KnowNews.service.imlp;

import cn.com.KnowNews.dao.daoImpl.CategoryDaoImpl;
import cn.com.KnowNews.entity.Category;
import cn.com.KnowNews.service.ICategoryService;

import java.util.List;

public class CategoryServiceImpl implements ICategoryService {

    @Override
    public List<Category> showAllCategory() throws Exception {
        CategoryDaoImpl categoryDao = new CategoryDaoImpl();
        return categoryDao.showCategory();
    }

    @Override
    public int delCate(int id) throws Exception {
        CategoryDaoImpl categoryDao = new CategoryDaoImpl();
        return categoryDao.delCate(id);
    }

    @Override
    public int addCate(String cate, String adder) throws Exception {
        CategoryDaoImpl categoryDao = new CategoryDaoImpl();
        return categoryDao.addCate(cate,adder);
    }
}
